<%@page import="aex.domain.ArticleCategory"%>
<%@page import="aex.domain.Article"%>
<%@page import="aex.service.ShowViewService"%>
<%@page import="aex.util.SSHUtil"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="aex.domain.Puser"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
WebApplicationContext ac = SSHUtil.getApplication(request);
ShowViewService svService = (ShowViewService) ac.getBean(ShowViewService.SERVICE_NAME);
%>

<!DOCTYPE>
<html>
  <head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <meta name="keywords" content="${webKeyWord}">
	<meta name="description" content="${webDescription}" />
	<title> ${webTitle} </title>
	<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
  	
	<link rel="stylesheet" type="text/css" href="expandStyle/aex_userPage.css">
	<link rel="stylesheet" type="text/css" href="expandStyle/index.css" />
	<link rel="stylesheet" type="text/css" href="expandStyle/comment.css" />
	<link rel="stylesheet" type="text/css" href="expandStyle/message.css" />
	<link rel="stylesheet" type="text/css" href="expandStyle/message1.css" />
	<link rel="stylesheet" type="text/css" href="expandStyle/users.css" />
	
	
	<script type="text/javascript" src="http://libs.useso.com/js/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="expandStyle/aex_userPage.js"></script>
	<script type="text/javascript" src="expandStyle/message.js"></script>
	<script type="text/javascript" src="expandStyle/mails.js"></script>
	
	</head>
  <body>
    
    <!--导航栏-->
    
    <%
    	Puser user=(Puser)request.getSession().getAttribute("user");
    	if(user==null){
    		%>
    			<jsp:include page="/systemPage/headNavVisitor1.jsp"></jsp:include>		
    		<%
    	}else{
    		%>
				<jsp:include page="/systemPage/headNavVisitor2.jsp"></jsp:include>
    		<%
    	}
    %>
	
<!--主要内容-->
  <div class="container">
  	 <div class="container_left">
  	
         <!--评论-->
        <div class="comment_article">
            <div class="comment_contentBox">
            
            <c:forEach var="item" items="${mails}">
              <div class="comment_line">
                <div class="tourist">
                   <img src="${item.puserByPuSend.puPhoto}" width="50px" height="50px" >
                  <div><a href="users.html">${item.puserByPuSend.puName}</a></div>
                </div>
                <div class="comment_content">
                  <div class="c_contentTop">
                  	${item.umContent}
                  	<br> 
                  
                  </div>
                  <div class="c_contentDown">
                                <span >${item.umTime}</span>
                   </div>
                </div>
              </div>
        	</c:forEach>
        
          </div>
          </div>
          
          <div class="play_comment" style='margin-top: 40px;'>
              <div class="comment_tittle">
              		回复
              </div>
              <form action="user/user_sendMail.do" method="post" class='sendForm'>
              	<input type="hidden" value="${herId}" name='herId' >
                <textarea name='content'></textarea>
                <div onclick="send(${herId})" class="button" id="p_comment">发送</div>
              </form>
            </div>
         </div>
       <script type="text/javascript">
       		function send(herId){
       			if(herId!=null){
       				$('.sendForm').submit();
       			}else{
       				alert('请先选择您要聊天的好友！');
       			}
       		}
       </script>
  	 
  	 
  	 <div class="container_right">
        <div id="message_box">
            <div class="message_title"><h2>好友列表</h2> </div>
            <div class="message_personBox">
            
             <c:forEach var="item" items="${contacts}">
             
             <c:choose>
             
             	<c:when test="${item.puId eq herId }">
	             <div class="message_person">
	                <img src="${item.puPhoto}" width="35px" height="35px" align="left"> <a class="person_color1" href="user/user_mails.do?herId=${item.puId}">${item.puName}</a>
	              </div>
             	</c:when>
             	<c:otherwise>
             		<div class="message_person">
	                <img src="${item.puPhoto}" width="35px" height="35px" align="left"> <a href="user/user_mails.do?herId=${item.puId}">${item.puName}</a>
	              </div>
             	</c:otherwise>
             </c:choose>
              
             
             
              </c:forEach>
              
            </div>
        </div>
     </div>

	</div>
	
    <!--网站底部-->
	<jsp:include page="/systemPage/footerVisitor.jsp"></jsp:include>
  </body>
</html>
